<!--this table is irregular and incomplete. headers need scopes, the summary must be completed, and empty cells should be avoided-->

<table summary="">
	<caption>Invitations: by status</caption>
	<thead>
		<tr>
			<td></td>
			<th>total</th>
		</tr>
	</thead>
	<tbody>
	  <% @invitations_by_status.each_pair do |status, count| %>
		<tr>
			<th><%= status.to_s %></th>
			<td><%= count.to_s %></td>
		</tr>
    <% end %>
	</tbody>
</table>

<!--this table is irregular and incomplete. headers need scopes, the summary must be completed, and empty cells should be avoided-->

<table class="stats" summary="">
	<caption>Invitations: by week</caption>
	<thead>
		<tr>
			<td></td>
			<%= @graph_dates.collect {|d| "<th>" + d.strftime('%m-%d-%y') + "</th>"}.join.html_safe %>
		</tr>
	</thead>
	<tbody>
	  <tr>
			<th>invitations created</th>
			<% @graph_dates.each do |date| %>
			<td><%= @invitations_created_weekly[date] ? @invitations_created_weekly[date].length : 0 %></td>
			<% end %>
		</tr>
		<tr>
			<th>invitations redeemed</th>
			<% @graph_dates.each do |date| %>
			<td><%= @invitations_redeemed_weekly[date] ? @invitations_redeemed_weekly[date].length : 0 %></td>
			<% end %>
		</tr>
	</tbody>
</table>
